#include "Product.h"

#include <cstring>

unsigned int pid_auto_increment = 0;

Product::Product(unsigned int category_id, const char* date, const char* name, float price)
{
  id = ++pid_auto_increment;
  this->category_id = category_id;
  this->date = new char[strlen(date)];
  strcpy(this->date, date);
  this->name = new char[strlen(name)];
  strcpy(this->name, name);
  this->price = price;
}

Product::~Product(void)
{
}

unsigned int Product::GetCategoryId(void)
{
  return category_id;
}

unsigned int Product::GetId(void)
{
  return id;
}

const char* Product::GetDate(void)
{
  return date;
}

const char* Product::GetName(void)
{
  return name;
}

float Product::GetPrice(void)
{
  return price;
}
